<?php
/**
 * Created by PhpStorm.
 * Author: Shadow
 * Date: 2022/5/7
 * Time: 8:11 上午
 * description: access.php
 * 做一个权限控制
 * 中间件检测HTTP请求、做一些处理
 */
use think\facade\Route;

//Route::get('/',"login/login");
Route::post('login',"login/login");

# 权限检测
Route::resource('menu','menu')->middleware(\app\access\middleware\CheckAccess::class);//菜单
Route::resource('admin','admin')->middleware(\app\access\middleware\CheckAccess::class);//菜单
Route::get('getInfo','admin/getInfo')->middleware(\app\access\middleware\CheckAccess::class);//菜单

# 模型关联

Route::resource('goods','goods');

Route::post('delete','Goods/delete');






//array:6 [
//    "id" => 2
//  "username" => "李四"
//  "password" => "e10adc3949ba59abbe56e057f20f883e"
//  "login_at" => null
//  "status" => 0
//  "role" => array:1 [
//    0 => array:5 [
//    "id" => 2
//      "role_name" => "开发人员"
//      "create_at" => null
//      "auth" => array:1 [
//    0 => array:7 [
//    "id" => 1
//          "auth_name" => "创建用户"
//          "controller" => "Admin"
//          "action" => "create"
//          "is_nav" => 0
//          "parent_id" => 5
//          "pivot" => array:2 [
//    "role_id" => 1
//            "auth_id" => 2
//          ]
//        ]
//      ]
//      "pivot" => array:2 [
//    "admin_id" => 2
//        "role_id" => 2
//      ]
//    ]
//  ]
//]










